2 * $VER: DetectPaulaAudio.c 1.0 (14.12.01) ® 2001 by Przemyslaw 'SENSEI' Gruchala <sensei@box43.gnet.pl>
7 #include <devices/ahi.h>
9 #include <exec/devices.h>
10 #include <exec/libraries.h>
11 #include <exec/types.h>
12 #include <utility/tagitem.h>
14 #include <proto/ahi.h>
15 #include <proto/dos.h>
16 #include <proto/exec.h>
18 UBYTE VersionID
[] = "$VER: DetectPaulaAudio.exe 1.0 (14.12.01) ® 2001 by Przemyslaw \'SENSEI\' Gruchala <sensei@box43.gnet.pl>";
22 int result
= RETURN_FAIL
;
23 struct MsgPort
*ahireplyport
;
24 if( ahireplyport
= CreateMsgPort() )
26 struct AHIRequest
*ahirequest
;
27 if( ahirequest
= CreateIORequest( ahireplyport
, sizeof( *ahirequest
) ) )
29 ahirequest
->ahir_Version
= 4;
30 if( !OpenDevice( AHINAME
, AHI_NO_UNIT
, (struct IORequest
*) ahirequest
, 0 ) )
32 struct Library
*AHIBase
= &ahirequest
->ahir_Std
.io_Device
->dd_Library
;
33 UBYTE drivername
[ 256 ];
34 if( AHI_GetAudioAttrs( AHI_DEFAULT_ID
, NULL
,
35 AHIDB_Driver
, drivername
,
36 AHIDB_BufferLen
, sizeof( drivername
),
39 Printf( "Driver name \"%s\".\n", drivername
);
40 if( !stricmp( drivername
, "paula" ) )
42 Printf( "Paula detected!\n" );
47 Printf( "Paula is not detected!\n" );
52 Printf( "Could not get AHI driver name!\n" );
53 CloseDevice( (struct IORequest
*) ahirequest
);
56 Printf( "Could not open \"%s\" V%ld!\n", AHINAME
, ahirequest
->ahir_Version
);
57 DeleteIORequest( (struct IORequest
*) ahirequest
);
60 Printf( "Could not create AHI request!\n" );
61 DeleteMsgPort( ahireplyport
);
64 Printf( "Could not create AHI reply port!\n" );